/**
 * tony
 * Apr 14, 2013
 */
package ttt.components;

import java.awt.Dimension;

import javax.swing.JLabel;

public class StatusBar extends JLabel {

	private static final long serialVersionUID = 6636723536300418971L;
	private int total = 0, won = 0, lost = 0, draw = 0;

    public StatusBar() {
        super();
        super.setPreferredSize(new Dimension(100, 16));
        setMessage();
    }
    
    public void addTotal() {
    	total++;
    	setMessage();
    }
    
    public void addWon() {
    	won++;
    	total++;
    	setMessage();
    }
    
    public void addLost() {
    	lost++;
    	total++;
    	setMessage();
    }
    
    public void addDraw() {
    	draw++;
    	total++;
    	setMessage();
    }
    
 	private void setMessage() {
        setText(" Total: " + total + " | Won: " + won + " | Lost: " + lost + " | Draw: " + draw);
    }
}